<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>我的快递</title>
<%@ include file="/pages/wx/baseHead.jsp"%>
<!-- #cb60b3 -->

<script type="text/javascript">
	
	
	$(function(){
	});
	
	function cancel(sn)
	{
		var url = '${urlBasePath}weixin/user/expressCancel.do';
		confirm('提示信息','您确定要撤消此单吗？',function(){
			$.ajax({
				url:url,
				async:true,
				data:
				{
					'v':(new Date()).valueOf(),
					'sn':sn
				},
				success:function(ret){
					debugger;
					if(ret.code == '0')
					{
						openToast(ret.msg);
						
						setTimeout(function(){
							goPage(1);
						},1000);
					}else
					{
						openDia('提示信息',ret.msg);
					}
				},
				error:function(){
					alert('调用失败');	
				}
			});
		});
	}
</script>

</head>
<body>
<form action="${urlBasePath }weixin/user/expressMySend.do" id="theform" name="theform" method="post">
<div class="bd" style="height: 100%;width: 100%; position: fixed;">
    <div class="weui_tab">
        <div class="weui_navbar" style="z-index: 20">
            <div class="weui_navbar_item weui_bar_item_on" onclick="to('${urlBasePath }weixin/user/expressMySend.do');" style="color: #ffffff;background-color: #04BE02;">
                	已寄快递
            </div>
            <div class="weui_navbar_item" onclick="to('${urlBasePath }weixin/user/expressMyReceive.do');">
               		收快递
            </div>
        </div>
        
        <div class="weui_tab_bd">
        
			<div class="weui_panel weui_panel_access">
			      <div class="weui_panel_bd" style="margin-top: -4px;">
			      
			      	<div class="input-group margin-bottom-sm form-inline has-success" style="padding: 10px 0 10px 0;text-align: center;display: none;">
					  <input class="form-control col-md-3" type="text" value="${q.expressNo }" name="expressNo" placeholder="请填入您想搜索的快递单号" style="height: 46px;z-index: 1;" >
					  <span class="input-group-addon"><a href="javascript:void(0);" onclick="goPage(1);"><i class="fa fa-search fa-sm"></i></a></span>
				    </div>
			      
			        <c:forEach var="obj" items="${objs.data }" >
			            <div class="weui_media_box weui_media_appmsg form-inline">
			                <div class="weui_media_bd" >
			                    <h4 class="weui_media_title" style="width: 100%;" onclick="to('${urlBasePath}weixin/user/expressDetail.do?sn=${obj.sn }');">收件人：${obj.directionName }      
			                    	<div style="float: right;font-size: .8em;">
									     <i class="fa fa-calendar fa-fw"></i><fmt:formatDate value="${obj.createTm}" pattern="yyyy-MM-dd"/>
									</div>
			                    </h4>
			                    <p class="weui_media_desc">
			                    	收件电话：
			                    	<span style="width: 60%">${obj.directionPhone }</span>
			                    </p>
			                    <p class="weui_media_desc">
			                    	快递费用：<fmt:formatNumber value="${obj.amount }" pattern="#,##0.00"/>元
			                    	<c:if test="${obj.forPublic == '01' }"><span style="color: #00CD00;"><i class="fa fa-product-hunt fa-fw"></i>对公</c:if>
			                    </p>
			                    <p class="weui_media_desc">
			                    	收件地址：
			                    	<span style="width: 60%">${obj.directionAddress }</span>
			                    </p>
			                    <p class="weui_media_desc">
			                    	揽件地址：
			                    	<span style="width: 60%">${obj.fromOperName }</span>
			                    </p>
			                    <c:if test="${obj.expressNo != null }">
					                <p class="weui_media_desc">快递单号：
					                		<font>${obj.expressNo }
						                    		<a href="http://m.kuaidi100.com/index_all.html?type=${obj.expressCode }&postid=${obj.expressNo }" style="color: red;"> &nbsp;配送查询</a>
					                    	</font>
					                </p>
				                </c:if>
			                </div>
			                
										
					        <div align="right" style="width: 60px;">
			                	<c:forEach var="state" items="${states }">
				                	<c:if test="${state.value == obj.state }">
						                    	${state.text }
				                  	 </c:if>
				                </c:forEach>
				                <c:if test="${obj.payState == '00' }"><div style="color: #04BE02;">已支付</div></c:if>
				                <div style="display: block;padding-top: 6px;"></div>
				                <c:if test="${(obj.state == '01' || obj.state == '02') && obj.payState != '00' }">
				                	<button type="button" onclick="cancel('${obj.sn}');"  class="weui_btn weui_btn_plain_primary weui_btn_mini">
						                    	撤单
						            </button>
				                </c:if>
				                <c:if test="${obj.amount > 0 && obj.forPublic == '02' && obj.payState != '00' }">
				                	<button type="button" onclick="goPayReady('${obj.sn}');"  class="weui_btn weui_btn_plain_primary weui_btn_mini">
						                    	支付
						            </button>
				                </c:if>
					         </div>
			            </div>
		        	</c:forEach>
		        	<c:if test="${fn:length(objs.data) == 0}">
				    	<div align="center" style="color: red;padding: 10px 0 20px 0px;">无数据</div>
				    </c:if>
			     </div>
		    </div>
			<%@ include file="/pages/wx/page.jsp"%>
			<div style="height: 40px;display: block;"></div>
        </div>
       
    </div>
</div>

 </form>

<div class="weui_tabbar" style="position: fixed;bottom: 0%;left: 0%;background-color:#04BE02;">
    <a href="${urlBasePath}weixin/user/expressSend.do" class="weui_tabbar_item weui_bar_item_on">
        <p class="weui_tabbar_label" style="line-height: 40px;font-size:1.2em;color: #ffffff;">
        	寄快递</p>
    </a>
</div>
<div style="height: 60px;display: block;"></div>

<div class="pop">
    <i class="fa fa-home fa-lg popi"></i>
</div>
<!-- 引入微信样式代码提示工具开始 -->
<%@ include file="/pages/wx/wxClass.jsp"%>
<!-- 引入微信样式代码提示工具结束 -->
<%@ include file="/pages/wx/baseBottom.jsp"%>
</body>
</html>

